{% extends "base.html" %}
{% from "macros/simple.html" import qux %}

{% block title %}Simple Macros - Flask Templates Demo{% endblock %}

{% block content %}
<div class="row">
    <div class="col-md-8">
        <h2>Simple Macros Example</h2>
        <p>This page demonstrates basic macro usage in Jinja2 templates.</p>
        
        <h3>Macro Definition</h3>
        <pre><code>{% raw %}{% macro qux(amount=1) %}
{% if amount == 1 -%}
I am qux.
{%- elif amount > 1 -%}
We are quxs.
{%- endif %}
{% endmacro %}{% endraw %}</code></pre>
        
        <h3>Macro Usage</h3>
        <p>Using the macro with default parameter (amount=1):</p>
        <div class="alert alert-info">
            <strong>Result:</strong> {{ qux() }}
        </div>
        
        <p>Using the macro with amount=3:</p>
        <div class="alert alert-info">
            <strong>Result:</strong> {{ qux(3) }}
        </div>
        
        <p>Using the macro with amount=0:</p>
        <div class="alert alert-info">
            <strong>Result:</strong> {{ qux(0) }}
        </div>
    </div>
    
    <div class="col-md-4">
        <div class="card">
            <div class="card-header">
                <h5>About Macros</h5>
            </div>
            <div class="card-body">
                <p>Macros in Jinja2 are comparable with functions in regular programming languages.</p>
                <p>They are useful to put often used idioms into reusable functions to not repeat yourself.</p>
                <p>Macros can be defined in any template and imported in other templates.</p>
            </div>
        </div>
    </div>
</div>
{% endblock %}